﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


class Board
{
    public string[,] InitialBoardDraw(string[,] board)
    {
        //string[,] board = new string[9, 9];

        for(int i = 0; i < 11; i++)
        {
            for(int j = 0; j < 17; j++)
            {
                if(i % 2 != 0 && j % 2 == 0)
                {
                    board[i, j] = "| ";
                }
                if (j % 2 != 0 && i % 2 == 0)
                {
                    board[i, j] = "------";
                }
                if (i % 2 == 0 && j % 2 == 0)
                {
                    board[i, j] = " ";
                }
                if (i % 2 != 0 && j % 2 != 0)
                {
                    board[i, j] = "     ";
                }
            }
        }
        return board;
    }

    public string[,] BoardPiecesStartDraw(Unit[] army, string[,] board, Player p)
    {
        int x;
        int y;
        for (int j = 0; j < army.Length; j++)
        {
            x = army[j].X;
            y = army[j].Y;
            if((!army[j].isDead()) && p.PName == "P1")
            {
                board[y, x] = p.PName + army[j].Name + army[j].Amount.ToString().PadLeft(2,'0');
            }
            else if((!army[j].isDead()) && p.PName == "P2")
            {
                board[y, x] = p.PName + army[j].Name + army[j].Amount.ToString().PadLeft(2, '0');
            }
            else
            {
                board[y, x] = "     ";
            }
        }

        return board;
    }

    public void BoardFinalDraw(string [,] board)
    {
        for (int i = 0; i < board.GetLength(0); i++ )
        {
            for (int j = 0; j < board.GetLength(1); j++)
            {
                Console.Write(board[i, j]);
            }
        Console.WriteLine();
        }
    }

    public int BoardCommand()
    {
        int commandCount = 0;

        while(true)
        {
            if (commandCount % 2 == 0)
            {
                Console.WriteLine("Player 1 needs ");
            }
           
        }
    }
}
